UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xkkW/LUw/llFl3I/iivnGbmBWOCaUIVVuPMd2aLRXHQ='
WHERE
key_id = '84f2792bf3258410218d7fe248d6dfcd6af1296d1cb52f94630a2b1a4eddf73a'
AND (
token = 'xkkW/LUw/llFl3I/iivnGbmBWOCaUIVVuPMd2aLRXHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)