UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YoCQkcqVBq924ZXUlslM4LZIvcZEnmnSvQRKxOcYyT8='
WHERE
key_id = 'd73ab7b01c2feb73c95b6d6f582c23d1bde2bbd2607d5475df9abe96f1e2b220'
AND (
token = 'YoCQkcqVBq924ZXUlslM4LZIvcZEnmnSvQRKxOcYyT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)