UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1U4Jlhbb2zNOjJO6RAL0lXmwZINEHngxFSN6WUVnZos=' 
WHERE 
  key_id = '4217a536c12f9bd90c74fcaad1f6f37b175462811b14e04dfecb6f0661af82fb' 
  AND (
    token = '1U4Jlhbb2zNOjJO6RAL0lXmwZINEHngxFSN6WUVnZos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035