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

Query time 0.00035