UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S0+djKOnOMJgfcSFlv0KB952P8DzBNUyXzTVh3Rl/As=' 
WHERE 
  key_id = 'bc3fd9a623ea0669620ae4b9bbcd2c18dab424fc5c40ac7ce409f2ae73cb1a11' 
  AND (
    token = 'S0+djKOnOMJgfcSFlv0KB952P8DzBNUyXzTVh3Rl/As=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037