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

Query time 0.00038