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