UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0FXYeYVGC3duNWRW/q1xK0d7wS4PtOeYTcEHGzK95Nc='
WHERE
key_id = 'eec5544867b565c39efc30b28b0472759992dbc5bf4ef19cfa01552f7e342ad9'
AND (
token = '0FXYeYVGC3duNWRW/q1xK0d7wS4PtOeYTcEHGzK95Nc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)