UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hntvwBdVFuc3eYAXNvKXltteFF4n9gk6yJsg7MJJ/4E='
WHERE
key_id = '200cd5a40e09ed7a87502f4ff277ae4a82d8b2897774369e05b4daac7eeb4f4d'
AND (
token = 'hntvwBdVFuc3eYAXNvKXltteFF4n9gk6yJsg7MJJ/4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)