UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uEy2IL2UBX9bcepCmgvBTc4twneyQKFVqcUg4dC/Vkg=' 
WHERE 
  key_id = '99d326c1b8bdd4e5436add54c2385a1f9a2d2bbe2844cab9709cf56d4e5dad0c' 
  AND (
    token = 'uEy2IL2UBX9bcepCmgvBTc4twneyQKFVqcUg4dC/Vkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033