UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kKRQr2Um87jUsP5sr92iDCncRaLMpouV07ZKBaSIihQ=' 
WHERE 
  key_id = 'e53bac1a885abe6d41a255c94e9d468f9473b042ddc168c6fc822ca5ce13b97e' 
  AND (
    token = 'kKRQr2Um87jUsP5sr92iDCncRaLMpouV07ZKBaSIihQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024