UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJ7nvFcHbJ7o62EAndigj/t0lQYqbJRr7HMys8r68kY='
WHERE
key_id = '81033ba9e1259b19d5fc0bc350fcb853b3d8a14e315386679e446bcf26b41e00'
AND (
token = 'tJ7nvFcHbJ7o62EAndigj/t0lQYqbJRr7HMys8r68kY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)