UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kj5e/I/4Bh06Fon7U321f0fqK9798tSogX0cn47X4kw=' 
WHERE 
  key_id = '36670cf348f843330dc2825add3bc2292e622820408e296beb9747d8d35c3ca8' 
  AND (
    token = 'kj5e/I/4Bh06Fon7U321f0fqK9798tSogX0cn47X4kw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023