UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XFSpMnaApwusG4ftCgr7E8FRYNUyNzNmOxT6DwSAink='
WHERE
key_id = '4faf12f1c38ccce040e39fe11d500137fe2c09da51cfb4fbcb6d506cc09fda1c'
AND (
token = 'XFSpMnaApwusG4ftCgr7E8FRYNUyNzNmOxT6DwSAink='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)