UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BZVDBBlHq9n3/273Z/DRoaZz48Gemtwf2fn+SESqrOg='
WHERE
key_id = '9db681b1f4227a364cb55cc6025a48e75f2f3ba1f53dc16c63b2f4429f22b27e'
AND (
token = 'BZVDBBlHq9n3/273Z/DRoaZz48Gemtwf2fn+SESqrOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)