UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZC6FiiNsD5a5pZQLET/9ZgbUB5d/h/9AzAetv2MkUgY='
WHERE
key_id = 'be57bd54919cc81cf4da49dc37f141d0f5552fffc2ef4dc134ab695357cae824'
AND (
token = 'ZC6FiiNsD5a5pZQLET/9ZgbUB5d/h/9AzAetv2MkUgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)