UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o57QR0CAlEpLL/+I/iJ6Dg0KthgFBgpGetwAgZWnYvE='
WHERE
key_id = 'd3df2267f9ae7bc0d77e307085e621c29861c511b8c29f66fb584cf00071bc2d'
AND (
token = 'o57QR0CAlEpLL/+I/iJ6Dg0KthgFBgpGetwAgZWnYvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)