UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XxsdM26SsJngHVyrmzd4j6Lwam+UkXBH5AfP9prWQeY='
WHERE
key_id = '1a3efb83f9d19efa794c7f051ef421d6d279dff51e4e634671e67c6f67f7ec90'
AND (
token = 'XxsdM26SsJngHVyrmzd4j6Lwam+UkXBH5AfP9prWQeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)