UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AphnOGfsfMtrwwS26igE0m9SW7ChPYuFWKvRTAk6hqc='
WHERE
key_id = '600e76d16815c5dbb29c9645e3d90302cee5bc481c17cbaabb11e51c27e275be'
AND (
token = 'AphnOGfsfMtrwwS26igE0m9SW7ChPYuFWKvRTAk6hqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)