UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Fgg5I/bgKP77ETbw9w/ouzRKufrHrmMgQfnCcS9vw8='
WHERE
key_id = 'c8eac038ca49c46ec35a30d784f772779abdde2fca78ba1ea0470ba5af6950a7'
AND (
token = '9Fgg5I/bgKP77ETbw9w/ouzRKufrHrmMgQfnCcS9vw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)