UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQt1eBbF+Qy8w84zNXJguLPXq9NoLHtIKGvwg5JWnXs='
WHERE
key_id = '5e454f517b3ed99137f32bd2d5d5843dfa6a97bc5de0a99371a6f8a1a8e1e6ee'
AND (
token = 'lQt1eBbF+Qy8w84zNXJguLPXq9NoLHtIKGvwg5JWnXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)