UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvQ2fbRQuAGUQaizLm28gZqar8+4kWJABF7Q23GyDUE='
WHERE
key_id = 'c7d8fbe386d39af07679b5fe6c4b8fb5f75967fc8a4b6edb42aded2a8e63d5ab'
AND (
token = 'PvQ2fbRQuAGUQaizLm28gZqar8+4kWJABF7Q23GyDUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)