UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v3/Iild0HqTrmEF36CzRRY6yNVNHBx3NNsTweXeQg6k='
WHERE
key_id = '2498bab9b0edc392e223e68f2f97c02503702a7565b17983e7d734eb95b254b8'
AND (
token = 'v3/Iild0HqTrmEF36CzRRY6yNVNHBx3NNsTweXeQg6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)