UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2bkEzevR9mOxkcvNGqWWI9u/a+4GUG/zDc67KgWPjE='
WHERE
key_id = '82e99d076d6e4752dc3cc3e3f53581dee496bcfd2022a7b4dd78e2ccf0dca24b'
AND (
token = 'D2bkEzevR9mOxkcvNGqWWI9u/a+4GUG/zDc67KgWPjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)