UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jSkfgEUwQVwd2zy9G8eovBQiQLE/rE1z0YXu2dxLWHg=' 
WHERE 
  key_id = 'b1eff47bb218e04406a3989e0746d8a299908f3b95e43f74146e24a0888c124c' 
  AND (
    token = 'jSkfgEUwQVwd2zy9G8eovBQiQLE/rE1z0YXu2dxLWHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017