UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QxLCXLLiQNrPPu2dkPLIAAxZW01Obig8BpLH9gD8d6M='
WHERE
key_id = '558e052aa66d853d023edf6371af2a836be01db46f92520060f8b86263bcc237'
AND (
token = 'QxLCXLLiQNrPPu2dkPLIAAxZW01Obig8BpLH9gD8d6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)