UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gBrozOoz4IT//ZNRBQ0p500ksTlR+yn/QiyLICib96s='
WHERE
key_id = 'fa0e962e9119b04baa3995e55e3a6f2c682a64c56251ec2f52f1d8a5f1172437'
AND (
token = 'gBrozOoz4IT//ZNRBQ0p500ksTlR+yn/QiyLICib96s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)