UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AnrZbtKlp4wuwPbfr0dAaFhGZs+Y4iISYIwgaOFhMII=' 
WHERE 
  key_id = '3d78813852d7d46263b095dda6f36f3cf1376eb4a6ad4c9e9c48915e7e66ad9e' 
  AND (
    token = 'AnrZbtKlp4wuwPbfr0dAaFhGZs+Y4iISYIwgaOFhMII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029