UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9lEg9q4aTSvXjB0+MJgfw5BoVzn008cjvy8Be7pOqk4='
WHERE
key_id = 'b0be25d76498e7877201e4183eedf24e07fac3eadeba4439f326935dade80fa9'
AND (
token = '9lEg9q4aTSvXjB0+MJgfw5BoVzn008cjvy8Be7pOqk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)