UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm3JOwPQ85mG63+nq//RyFPAdhAYXpXebiFgK0JZlRLM=' 
WHERE 
  key_id = 'cbedec73e390d863d6ae1dffccdf297c3494833cd402d32368c2f37d9b0039ac' 
  AND (
    token = 'm3JOwPQ85mG63+nq//RyFPAdhAYXpXebiFgK0JZlRLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027