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