UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '25ipaz3EvCETZ99VaK42Inv+T3GIaJhiE1COydeuptw='
WHERE
key_id = 'b2295e3bff38f6e2c2ba669fba59c10966d4d3d20b8ae092ec637b319631163b'
AND (
token = '25ipaz3EvCETZ99VaK42Inv+T3GIaJhiE1COydeuptw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)