UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rxCKG61LDlvDPZ8aTwtixinwqBQSmprRi+F2i220wpc='
WHERE
key_id = '8ca800eadeb028e495063f77a49c6b0c799259f83f921c8cee52de809d60c43a'
AND (
token = 'rxCKG61LDlvDPZ8aTwtixinwqBQSmprRi+F2i220wpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)