UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FV/XXLKmgPvZNodQnbY7CGmamqIuRMGBz66vrVu8EN0='
WHERE
key_id = '8f455106ebc0951e54919887234e40ec40b252f30e699b35547cec613bf4a683'
AND (
token = 'FV/XXLKmgPvZNodQnbY7CGmamqIuRMGBz66vrVu8EN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)