UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'INaAdZaPbpzBwfRH1ivWX3+of3BcaSks6Lr3X96C0i8='
WHERE
key_id = '8adfa500b7b6db80ae9c9eb899811e5bd16894a86be485822a50df70a32b31d0'
AND (
token = 'INaAdZaPbpzBwfRH1ivWX3+of3BcaSks6Lr3X96C0i8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)