UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MTGMoAOGGlFWRyS4Z0zyRKr4DgosQ2/2yRigYsRi6Tc=' 
WHERE 
  key_id = 'a3caa69116e30f899c3be0f3b8c614f33ffc0ff5f77f385ff5857c3afc692393' 
  AND (
    token = 'MTGMoAOGGlFWRyS4Z0zyRKr4DgosQ2/2yRigYsRi6Tc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034