UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTWwr21f2c+fT4R4AheePrUwvcLFVhRrdiY0P3CM4FA='
WHERE
key_id = '49d9c879f36079e77ab803acaecb5023711c30ddefced00abca09ad049b586d1'
AND (
token = 'sTWwr21f2c+fT4R4AheePrUwvcLFVhRrdiY0P3CM4FA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)