UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ngKPr8vQ59HzdKaWiSVVLkXVfLv6FYmFdSggEVXJF0Y=' 
WHERE 
  key_id = '05b60161e84f835494383ff26ae901399763f959b91f257aafc3f80be7fbb099' 
  AND (
    token = 'ngKPr8vQ59HzdKaWiSVVLkXVfLv6FYmFdSggEVXJF0Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034