UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Bj7zfDlxFp1X3Mc8Biw+Z5kfcX8lEriLIGZm2Ge0TA='
WHERE
key_id = 'e2a0a3c952d3a3b65ae17b0647f8b492b341005ba64d1b22a181285810c24b86'
AND (
token = '4Bj7zfDlxFp1X3Mc8Biw+Z5kfcX8lEriLIGZm2Ge0TA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)