UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PspOCG4ez5Szzgs7plAqLxUisWixZwOwpFvJYQZiuFI='
WHERE
key_id = '80694bcc5e19d38a4b3e8fb893e920ed023ee899b17007d593e4081183200451'
AND (
token = 'PspOCG4ez5Szzgs7plAqLxUisWixZwOwpFvJYQZiuFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)